#ifndef __PWHDR_PWIOPOLLSELECT_HPP__
#define __PWHDR_PWIOPOLLSELECT_HPP__

namespace purewell
{
class PWIOPollSelect : public PWIOPoll
{
public:
	PWIOPollSelect();
	inline virtual ~PWIOPollSelect() {}

	virtual bool add(PWFile* pfile, int event);
	virtual bool add(PWPairFile* pfile, size_t idx, int event);
	virtual bool modify(PWFile* pfile, int event);
	virtual bool modify(PWPairFile* pfile, size_t idx, int event);
	virtual bool modify(int fd, int event);
	virtual bool remove(PWFile* pfile);
	virtual bool remove(PWPairFile* pfile, size_t idx);
	virtual bool remove(int fd);

	virtual bool dispatch(int msec);
	virtual const char* getType(void) const;

public:
	virtual bool initialize(void* param);
	virtual void destroy(void);

private:
	typedef std::map<int, PWFile*>	fdmap_t;
	typedef fdmap_t::iterator		fdmap_itr;
	typedef fdmap_t::const_iterator	fdmap_citr;

private:
	fdmap_t		m_fds;
	fd_set		m_rset;
	fd_set		m_wset;
	fd_set		m_eset;
};

};//namespace purewell

#endif//__PWHDR_PWIOPOLLSELECT_HPP__



